<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
 * @method static paginate(array|\Illuminate\Contracts\Foundation\Application|\Illuminate\Http\Request|string|null $request)
 * @method static inRandomOrder()
 */
class Lesson extends Model
{
    use HasFactory;

    protected $fillable = ['title', 'description', 'preview'];

    /**
     * @return HasMany
     */
    public function videos(): HasMany
    {
        return $this->hasMany(Video::class);
    }

    /**
     * @return BelongsTo
     */
    public function system(): BelongsTo
    {
        return $this->belongsTo(System::class);
    }
}
